<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://xmlns.jcp.org/jsf/facelets"
      xmlns:h="http://xmlns.jcp.org/jsf/html"
      xmlns:p="http://primefaces.org/ui">

    <body>

        <ui:composition template="./templates/TemplatePagina.xhtml">

            <ui:define name="barraTitulo">

            </ui:define>

            <ui:define name="barraMenu">

            </ui:define>

            <ui:define name="conteudo">
                <h:form>
                    <p:panel>
                        <h:panelGrid>
                            <h:outputLabel value="Nome: "/>
                            <h:inputText value="#{atorController.selecionado.nome}"/>

                            <h:outputLabel value="Sobrenome: "/>
                            <h:inputText value="#{atorController.selecionado.sobrenome}"/>

                            <h:commandButton action="#{atorController.adicionar}" value="Cadastrar"/>

                        </h:panelGrid>
                        <p:panel header="Lista de atores">
                            <p:dataTable value="#{atorController.itens}" var="item">
                                <p:column headerText="Nome">
                                    <h:outputText value="#{item.nome}"/>
                                </p:column>

                                <p:column headerText="Sobrenome" filterBy="#{item.sobrenome}">
                                    <h:outputText value="#{item.sobrenome}"/>
                                </p:column>

                                <h:button value="Novo Ator" outcome="CadastrarAtor.xhtml"/>
                            </p:dataTable>
                        </p:panel>
                    </p:panel>
                </h:form>
            </ui:define>

            <ui:define name="rodape">

            </ui:define>

        </ui:composition>

    </body>
</html>
